﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Demo_Excel列表框.View
{
    /// <summary>
    /// List_2.xaml 的交互逻辑
    /// </summary>
    public partial class List_2 : UserControl
    {
        public List_2()
        {
            InitializeComponent();
            DataContext = ViewModel.ViewModel.GetInstance().m_Model_MainWindow;
        }

        private void MouseDoubleClick_ListModel(object sender, MouseButtonEventArgs e)
        {

        }
        private void button_CreateCsv_Click(object sender, RoutedEventArgs e)
        {

        }

        private void btn_Add_Click(object sender, RoutedEventArgs e) => ViewModel.ViewModel.GetInstance().m_Model_MainWindow.AddModel2(true,"2","Lime");

        private void btn_Clear_Click(object sender, RoutedEventArgs e) => ViewModel.ViewModel.GetInstance().m_Model_MainWindow.m_LG2.Clear();

        private void button_ChangeLineColor_Click(object sender, RoutedEventArgs e)
        {
            MenuItem MI = sender as MenuItem;
            ViewModel.ViewModel.GetInstance().m_Model_MainWindow.ChangeLineColors(LG2.SelectedIndex, int.Parse(MI.Name.Substring(5, 1)));
        }
    }
}
